Something I miss .... 

If you try my previous hint, the field currencyCode
assignment from sales line will be overwritten by the
standard currency code. If you want to keep your
markupTrans record to have currency code from
salesLine, perhaps you don't have to call initValue(),
but just do this:

mt.initFromSalesLine(trans.salesLine());
mt.lineNum = MarkupTrans::lastLineNum(
                                 mt.transTableId,
                                 mt.transRecId) + 1;

Or anyway suitable for you (since sometimes
initValue() cannot be just ignored), just to assure
that lineNum's value is assigned after transTableId
and transRecId have been specified.

-Aji Sarosa-

--- Aji Sarosa <[EMAIL PROTECTED]> wrote:

> Hi Ince,
> 
> Every record inserted to MarkupTrans must be unique
> based on these three fields as a key:
> - TransTableId
> - TransRecId
> - LineNum
> You can check index TransRecIdIdx for MarkupTrans to
> verify this.
> 
> The value of field LineNum is assigned in method
> initValue() based on TransTableId and TransRecId.
> 
> this.lineNum = MarkupTrans::lastLineNum(
>                                  this.transTableId,
>                                  this.transRecId) +
> 1;
> 
> But the field transTableId (=??) and transRecId
> (=??)
> are not yet filled in at the time initValue() is
> called, which means lineNum's value built will NOT
> represent (the last lineNum + 1) for the expected
> transTableId and transRecId.
> 
> So, instead of call table's method in this sequence:
> 
> // assign lineNum
> mt.initValue();
> // assign transTableId and transRecId
> mt.initFromSalesLine(trans.salesLine());
> 
> try to change the sequence like this:
> 
> // assign transTableId and transRecId
> mt.initFromSalesLine(trans.salesLine());
> // assign lineNum
> mt.initValue();
> 
> so the field transTableId and transRecId are
> guaranteed to be filled in before lineNum's
> assignment.
> 
> Hope this helps.
> 
> -Aji Sarosa-
> 



                
__________________________________ 
Do you Yahoo!? 
Dress up your holiday email, Hollywood style. Learn more. 
http://celebrity.mail.yahoo.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/kGEolB/TM
--------------------------------------------------------------------~-> 

Sharing the knowledge on Axapta. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Axapta-Knowledge-Village/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to