how do i set the FXRate in Shipment_LineDisplayCompleted

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

how do i set the FXRate in Shipment_LineDisplayCompleted

Postby indikad » Wed Jun 24, 2009 5:14 pm

Breakout
window: Purchase Orders | shipments
These lines of code does not work - it compiles but crashes JIWA.

JiwaShipmentObject.ShipmentLines.Item(1).FXRate = 59.36
JiwaShipmentObject.ShipmentLines.Item(1).FXRate = "59.36"

however I can read no problem
msgbox CStr( JiwaShipmentObject.ShipmentLines.Item(1).FXRate )

what am I doing wrong ?
any help is appreciated.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: how do i set the FXRate in Shipment_LineDisplayCompleted

Postby Mike.Sheen » Wed Jun 24, 2009 9:30 pm

indikad wrote:Breakout
window: Purchase Orders | shipments
These lines of code does not work - it compiles but crashes JIWA.

JiwaShipmentObject.ShipmentLines.Item(1).FXRate = 59.36
JiwaShipmentObject.ShipmentLines.Item(1).FXRate = "59.36"

however I can read no problem
msgbox CStr( JiwaShipmentObject.ShipmentLines.Item(1).FXRate )

what am I doing wrong ?
any help is appreciated.


Indika,

I've just had a try of this and I can set it fine. I suspect which breakout in which you execute the line of code :
Code: Select all
JiwaShipmentObject.ShipmentLines.Item(1).FXRate = 59.36


Is important.

I added a custom menu option to the shipment form by adding this line to the Form Loaded breakout :
Code: Select all
   VBFormObject.mRecordCustom(0).Caption = "Test"
   VBFormObject.mRecordCustom(0).Visible = True


and then in the Form Custom Menu Clicked, I added this code :
Code: Select all
   JiwaShipmentObject.ShipmentLines.Item(1).FXRate = 59.36


and when I run this, it sets the FX Rate no problem.

Let me know which particular breakout you are trying to set the FX Rate, and I'll test again - also it may be important to know what other properties or methods your breakout is setting/calling preceding the line of code in question.

Also, you may like to let me know which version of Jiwa you are trying this on.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: how do i set the FXRate in Shipment_LineDisplayCompleted

Postby Mike.Sheen » Wed Jun 24, 2009 9:48 pm

Indika,

Sorry - I failed to see the subject of your post contained the breakout in question which I asked you for : "Shipment Line Display Completed".

I've tried this also, and do have a problem - but I get an error : Out of Stack Space - which makes sense, given what you're trying to do.

Line Display Completed will get called whenever ANY property of a line changes, so there's an infinite recursive loop being produced - hence the out of stack space error.

The order of events is as follows :

1. Shipment is displayed, this invokes the DisplayShipmentLines method of the FORM
2. The DisplayShipmentLines (of the FORM) method iterates through the business logic collection of shipmentlines, adding each line to the grid and after adding it invokes the breakout Shipment Line Displayed
Shipment Line Displayed breakout for each Line
3. Your shipment Line Displayed breakout sets the property FXRate.
4. The business logic property LET of the ShipmentLine handles the change and raises an event - "Changed"
5. The business logic property ShipmentLines handles the items' change event and raises an event "Changed"
6. The business logic handles the ShipmentLines change event and raises an event "LinesChanged"
7. The Form handles the event businesslogic changed and displays the lines : GOTO step 2.

DO NOT set business logic properties in FORM based events which arise from a property change (eg : Not a Lines Displayed handler). You should be able to find a way to do this in the existing breakouts.

Post back here if you still have troubles, I'm sure we can work out a way to do what you want - make sure you post the conditions on which you want to set the FXRate.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: how do i set the FXRate in Shipment_LineDisplayCompleted

Postby indikad » Fri Jun 26, 2009 10:59 am

Hi Mike,
Thanks for taking an interest in this.
What I want to do is this:
The user will create a shipment based on a Pre-created purchase order. The PO would have been created with a foreign currency rate - ( they set the same rate for all lines).
What JIWA does is to set the current rate when a shipment is created - which is all fine. But I want to bring the rate that was used in the PO.
This, I want to happen automatically when the shipment is "populated" on the screen from the PO.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: how do i set the FXRate in Shipment_LineDisplayCompleted

Postby Mike.Sheen » Sat Jun 27, 2009 4:20 pm

indikad wrote:I want to bring the rate that was used in the PO.
This, I want to happen automatically when the shipment is "populated" on the screen from the PO.


Ok, so you should try this in the "Shipment - Line Added" breakout. This is a business logic event fired whenever a line is added - including when added as a result of adding a purchase order.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: how do i set the FXRate in Shipment_LineDisplayCompleted

Postby indikad » Thu Jul 02, 2009 1:34 pm

Thanks Mike, will try this.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2


Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 5 guests