Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Description field and validation rules

Hi Bill,
is there a way of getting the description from the metadata. I was querying SYS_SFFIELDS which does not seem to extract this fields (although helptext is extracted).
Would this field be available from another DB amp utility? Also is there a way of extracting validation rules.
Thanks
Helen

Thanks
Helen
1 person has
this question
+1
Reply
  • You need to the DBAmp Salesforce Metadata support to get this type of information.

    See the Metadata chapter in the DBAMp Manual http://www.forceamp.com/hats/DBAmpDoc...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Hi Bill,
    Thanks for this. I used SF_Metadata stored procedure as per the example in the manual. Getting an error message which says. This user does not have permission to manage Salesforce Knowledge. We do not have Salesforce Knowledge installed.
    Does this stored proc require Sales Force knowledge.
    Also could you please advise on the best way of retrieving all the validation rules.

    Thanks
    Helen
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Could you send me the commands that you are running and the complete message output? Please forward to the support at forceAmp.com email.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Hi Bill,
    This is it. I do get the list of objects fields and descriptions but the last part of the query fails with the salesforce knowledge error. The query comes from the SF_METADATA page in the DBAMP documentation.

    (1 row(s) affected)
    --- Starting SF_Metadata for MD_FieldDesc
    12:38:27: Run the DBAmpNet.exe program.
    12:38:27: DBAmpNet V2.19.2 (c) Copyright 2014 forceAmp.com LLC
    12:38:27: Connection to SQL successful.
    12:38:35: Performing LIST for CustomObject - *
    12:38:36: Ending DBAmpNet. Operation successful.
    --- Ending SF_Metadata. Operation successful.

    (1 row(s) affected)

    (0 row(s) affected)
    --- Starting SF_Metadata for MD_FieldDesc
    12:38:38: Run the DBAmpNet.exe program.
    12:38:38: DBAmpNet V2.19.2 (c) Copyright 2014 forceAmp.com LLC
    12:38:44: Sending Retrieve package to https://cs22.salesforce.com/services/...
    12:39:51: Retrieve response received from salesforce.
    12:39:53: package.xml : This user does not have permission to manage Salesforce Knowledge. CustomObject named: FAQ__kav
    12:39:53: Ending DBAmpNet. Operation FAILED.
    12:39:55: Error: DBAmpNet.exe was unsuccessful.
    12:39:55: Error: Command string is C:\"Program Files"\DBAmp\DBAmpNet.exe Retrieve "MD_FieldDesc" "PTM-DB11\SQLDEV1" "SalesforceBackups" "Staging"
    --- Ending SF_Metadata. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_Metadata, Line 137
    --- Ending SF_Metadata. Operation FAILED.

    (1497 row(s) affected)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • This is the query

    Drop Table MD_FieldDesc
    go
    CREATE TABLE MD_FieldDesc (
    [Name] [nvarchar](255) NULL,
    [Member] [nvarchar](255) NULL,
    [MetadataXML] [xml] NULL,
    [CreatedByWildcard] [bit] NULL,
    [CreatedByList] [bit] NULL,
    [Error] [nvarchar](255) NULL,
    [Id] [nchar](18) NULL
    )
    INSERT INTO MD_FieldDesc (Name,Member) Values ( 'CustomObject', '*')
    -- Get a list of objects with customer fields
    Exec SF_Metadata 'List', 'Staging', 'MD_FieldDesc'
    -- Cleanup wildcard and objects that will error
    Delete MD_FieldDesc where Member = '*'
    Delete MD_FieldDesc where Member = 'SiteChangeList'
    -- Retrieve the field metadata
    Exec SF_Metadata 'Retrieve', 'Staging', 'MD_FieldDesc'
    -- Query to select descriptions
    ;WITH XMLNAMESPACES(DEFAULT 'http://soap.sforce.com/2006/04/metadata') SELECT Member
    ,fn.c.value('(fullName)[1]','nvarchar(50)') as FieldName
    ,fn.c.value('(description)[1]','nvarchar(50)') as Description
    --,fn.c.value('(../fullName)[1]','nvarchar(50)') as PicklistValue ,fn.c.value('(.)[1]','nvarchar(50)') as ControllingPicklistValue
    FROM MD_FieldDesc
    cross apply metadataxml.nodes ('/CustomObject/fields') as fn(c)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • The complete output. (The query as per previous email)

    (1 row(s) affected)
    --- Starting SF_Metadata for MD_FieldDesc
    12:38:27: Run the DBAmpNet.exe program.
    12:38:27: DBAmpNet V2.19.2 (c) Copyright 2014 forceAmp.com LLC
    12:38:27: Connection to SQL successful.
    12:38:35: Performing LIST for CustomObject - *
    12:38:36: Ending DBAmpNet. Operation successful.
    --- Ending SF_Metadata. Operation successful.

    (1 row(s) affected)

    (0 row(s) affected)
    --- Starting SF_Metadata for MD_FieldDesc
    12:38:38: Run the DBAmpNet.exe program.
    12:38:38: DBAmpNet V2.19.2 (c) Copyright 2014 forceAmp.com LLC
    12:38:44: Sending Retrieve package to https://cs22.salesforce.com/services/...
    12:39:51: Retrieve response received from salesforce.
    12:39:53: package.xml : This user does not have permission to manage Salesforce Knowledge. CustomObject named: FAQ__kav
    12:39:53: Ending DBAmpNet. Operation FAILED.
    12:39:55: Error: DBAmpNet.exe was unsuccessful.
    12:39:55: Error: Command string is C:\"Program Files"\DBAmp\DBAmpNet.exe Retrieve "MD_FieldDesc" "PTM-DB11\SQLDEV1" "SalesforceBackups" "Staging"
    --- Ending SF_Metadata. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_Metadata, Line 137
    --- Ending SF_Metadata. Operation FAILED.

    (1497 row(s) affected)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • The last message indicates that the final query gave 1497 rows.

    Is that not the data you requested ?

    The error message is simply saying that it cannot give you the field description information for a knowledge table since the sf user does not have permission. You do have Salesforce Knowledge installed on your salesforce system; this user simply does not have access to it.

    In spite of this, the remaining field descriptions were provided.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned