Thanks a lot Aji,

Before I saw your answer I spent a lot of time on
figuring all of this out. You confirm what I learned
meanwhile.

Nevertheless the thing I still do not catch is where
the container checkIfupdate gets its values. During my
analysis I did find the method checkIfUpdate() on the
SalesTable but I do not understand how the container
is build.

The main reasons why I am asking this is because I
want to add an extra document to it.
I saw the whole stuff with the posQuotation method and
the mayQuotationBeUpdated method.

I noticed that when the method
enableUpdateJournalButtons is run the else loop is
executed. Whereas normally the method
mayQuotationBeUpdated is called within the if loop I
noticed that the statement checkIfupdate =
_salesTable.checkIfUpdate() calls the
mayQuotationBeUpdated also.

That is where I am lost! How can this method build the
container and how can it call the
mayQuotationBeUpdated method.

I would appreciate it if you could tell me how it is
done.

I have temporarily solved it by assigning the enable
value for my new document hardcoded, setting it to
true. But this is not the longterm solution.

regards,
Danny

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

> Hi Danny,

> As you may see in salesTable form, there is a menu
> button labeled "Posting" to post sales order into:
>  - quotation
>  - confirmation
>  - picking list
>  - picking list registration
>  - packing slip
>  - invoice

> Method enableUpdateJournalButtons(...) is called to
> enable/disable those menu buttons
> (quotation, confirmation, etc) according to some
> criteria. For example, when you have a sales order
> with status 'delivered', the confirmation button
> will be disabled. Table method checkIfUpdate() is
> called inside the method to compose "the list of
> enable status" of each menu button. The
> implementation to build the container is actually
> done in method checkIfUpdate() of class
> SalesTableType.

> The enable status, which is a boolean value, is
> arranged in a structured order inside the container.
> There are 7 elements inside the container, that's
> why you get the value <7> which means "7 elements".
> Each element, in this case, consists of a boolean
> value with value 1 for "enabled" and 0 for
> "disabled".

> element 1 for the activation status of quotation
> button
> element 2 for the activation status of confirmation
> button
> element 3 for the activation status of picking list
> button
> element 4 for the activation status of picking list
> registration button
> element 5 for the activation status of packing slip
> button
> element 6 for the activation status of invoice
> button
> element 7 for the activation status of project
> packing slip button

> To avoid hardcoding, the index of each element is
> accessed via static methods. For example
> SalesType::posQuotation() is used to get the index
> of quotation button status inside the container,
> which returns 1. SalesType::posConfirmation()
> returns 2, and so on. The following code show how
> one element of the container is constructed in
> method checkIfUpdate() of class SalesTableType:

> // method canQuotationBeUpdated() is used to
> determine whether the quotation button
> // can be enabled or not. the returned value is then
> inserted as the 1st element inside
> // container c.
> // imagine the code as: c = insert_into_container(c,
> 1, determine_and_get_status())

>  c = conIns(c, SalesTableType::posQuotation(),
> this.canQuotationBeUpdated());

>  // ... and so on
>
> If you debug the returned container of
> checkIfUpdate() method, you can see the values
> inside. For example:
>
> <7>
>       0
>       0
>       1
>       1
>       1
>       1
>       0

> It means, (in top-down order):
>
> quotation button:                    to be disabled
> confirmation button:                to be disabled
> picking list button:                  to be enabled
> picking list registration button: to be enabled
> packing list button:                 to be enabled
> invoice button:                        to be enabled
> project packing slip button:      to be disabled

> The following code is used to get the status of a
> button from the returned container:

> // get the status of quotation button from the 1st
> element of the container
> // imagine the code as:
> // enableQuotationButton =
> get_container_element(enable_status_container, 1);

> enableQuotationButton = conPeek(checkIfupdate,
> SalesTableType::posQuotation());
>        
>  // and so on ...
>         
> After the status is captured, then the button will
> be enabled/disabled by the following code:

> // if enableQuotationButton == 1, enable quotation
> button; otherwise disable
>
>
buttonUpdateQuotation.enabled(enableQuotationButton);

> Hope this helps.

> -Aji Sarosa-

>
> dgaethofs <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> Can somebody tell me what exactly the method
> checkIfUpdate is doing
> on the tables SalesTable.
>
> The method is called from the method
> enableUpdateJournalButtons on
> the class SalesTableForm. CheckIfUpdate is a
> container in the method
> enableUpdateJournalButtons. It is assigned a value
> retrieved via the
> method checkIfUpdate() on the SalesTable. In my case
> the value <7>
> is returned by the method checkIfUpdate(). Where is
> this value
> coming from ? Where is it stored or where did the
> method find it?
>
> regards,
> Danny
>
>
>
>
>
>
>
> Yahoo! Groups SponsorADVERTISEMENT
>
>
> ---------------------------------
> Yahoo! Groups Links
>
>    To visit your group on the web, go to:
> http://groups.yahoo.com/group/development-axapta/
>  
>    To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>  
>    Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been
> removed]
>
>



           
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to