default true for boolean type

bangswitbangswit Member Posts: 265
how to set default value boolean type = true?

Answers

  • rhpntrhpnt Member Posts: 688
    Are you serious?
  • bangswitbangswit Member Posts: 265
    rhpnt wrote:
    Are you serious?
    ????
  • vijay_gvijay_g Member Posts: 884
    need more clearification how abt requirment?
  • rhpntrhpnt Member Posts: 688
    ????

    There are many different ways to set a default value.

    The simplest one you almost provided yourself:
    BooleanValue := TRUE;
    (commonly used in a form, report,...)

    Another way to set the default value is in the property of the field in a table. You see, there are different ways and kinds of setting a default value which depend on the requirements, objects and general circumstances. I suggest you read the App. Dev. Guide provided with every NAV installation CD.
  • bangswitbangswit Member Posts: 265
    i mean
    i want to add new field in Sales Invoice Header
    which is come from posted from sales header
    so i want to that boolean field should be true
  • TomasTomas Member Posts: 420
    If you need to set TRUE as default value for your boolean field in a table, search for "InitValue" property in documentation.
  • krikikriki Member, Moderator Posts: 9,110
    A lot easier : invert the logic of the field you want to set the default value.
    Example:
    If you want a boolean for "Default Customer" on the customer card and the default must be TRUE.
    It is easier (no need to add some code to put it to TRUE as a default) to have a boolean "Normal Customer" with default FALSE.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rhpntrhpnt Member Posts: 688
    i want to add new field in Sales Invoice Header
    which is come from posted from sales header
    so i want to that boolean field should be true

    I'm not sure I got it right but in your case the value will always be true!? Every Sales Invoice Header starts as a Sales Header why would you want to add a useless field like that?
  • bangswitbangswit Member Posts: 265
    rhpnt wrote:
    i want to add new field in Sales Invoice Header
    which is come from posted from sales header
    so i want to that boolean field should be true

    I'm not sure I got it right but in your case the value will always be true!? Every Sales Invoice Header starts as a Sales Header why would you want to add a useless field like that?

    i want to exported it to txt file
    so i want to give it a flag
    like i true, it means i already flag it
  • SavatageSavatage Member Posts: 7,142
    if you set it to true on the sales order and when you post you want it to transfer over to the posted invoice header just
    create the same field name & number in the posted invoice header & it will transfer.

    Is this what you're asking?
  • bangswitbangswit Member Posts: 265
    Savatage wrote:
    if you set it to true on the sales order and when you post you want it to transfer over to the posted invoice header just
    create the same field name & number in the posted invoice header & it will transfer.

    Is this what you're asking?
    nope...
    so in order doesn't appear the boolean type
    only in posted document
  • SavatageSavatage Member Posts: 7,142
    First You ask...
    bangswit wrote:
    how to set default value boolean type = true?

    The answer is given...
    rhpnt wrote:
    BooleanValue := TRUE;

    YOU then say you want it to come from the sales header..
    bangswit wrote:
    i mean
    i want to add new field in Sales Invoice Header
    which is come from posted from sales header
    so i want to that boolean field should be true

    I ask to clarify if that's what you want & you say NO....
    bangswit wrote:
    Savatage wrote:
    if you set it to true on the sales order and when you post you want it to transfer over to the posted invoice header just
    create the same field name & number in the posted invoice header & it will transfer.

    Is this what you're asking?
    nope...
    so in order doesn't appear the boolean type
    only in posted document

    We also need to know why you need it if you want it to always be TRUE...
    rhpnt wrote:
    I'm not sure I got it right but in your case the value will always be true!? Every Sales Invoice Header starts as a Sales Header why would you want to add a useless field like that?

    YOu really need to be clear else we're going in circles.

    Do you want a boolean on the posted INvoice Header ONLY! And it to be editable & changeable?
  • SLF25SLF25 Member Posts: 37
    The way I understood this twaddle is, he probably wants to export a txt file after posting an invoice and mark that with a boolean field in posted invoice header. But he says it should be TRUE by default, so I am probably wrong.
  • rhpntrhpnt Member Posts: 688
    Or he wants to set false to documents who failed to export. Who knows... :-k
  • bangswitbangswit Member Posts: 265
    sorry everyone to make all of you confuse
    i just want to set a flag... which records have exported yet
    but this problem already solved
    thanks for the help
  • AndwianAndwian Member Posts: 627
    bangswit wrote:
    but this problem already solved
    How?
    Regards,
    Andwian
  • bangswitbangswit Member Posts: 265
    Andwian wrote:
    bangswit wrote:
    but this problem already solved
    How?

    i reverse the code
    after posting it still boolean type false
    and then after export i set it become true...
  • SavatageSavatage Member Posts: 7,142
    How did you get around the restriction of the Sales Invoice Header table?
    It's usually not changable to end-users and gives a message "You don't have permission ....."

    We handle that by adding code to CU391
  • bangswitbangswit Member Posts: 265
    Savatage wrote:
    How did you get around the restriction of the Sales Invoice Header table?
    It's usually not changable to end-users and gives a message "You don't have permission ....."

    We handle that by adding code to CU391

    i have developer license
  • AndwianAndwian Member Posts: 627
    bangswit wrote:
    i reverse the code
    after posting it still boolean type false
    and then after export i set it become true...
    Good idea! Many ways to Rome.
    Regards,
    Andwian
  • SavatageSavatage Member Posts: 7,142
    bangswit wrote:
    Savatage wrote:
    How did you get around the restriction of the Sales Invoice Header table?
    It's usually not changable to end-users and gives a message "You don't have permission ....."

    We handle that by adding code to CU391

    i have developer license
    Ok then :whistle:
  • Ian_Piddington10199Ian_Piddington10199 Member Posts: 167
    Yeah......


    You may want to test that with the customers license.

    Ian
    Regards

    Ian
  • krikikriki Member, Moderator Posts: 9,110
    And if it doesn't work with customer license, you need to add the permission to modify the table in the object (object property Permissions) that does the modify.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.